package com.woniuxy.yoga.progress.client;

import com.woniuxy.yoga.commons.core.model.Result;
import com.woniuxy.yoga.feign.config.FeignConfig;
import com.woniuxy.yoga.progress.model.dto.OrderInfoDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;


@FeignClient(name = "order-service",configuration = FeignConfig.class,path = "/order")
public interface OrderClient {

    /**
     * 通过订单编号返回订单信息
     * @param orderNum 订单编号
     * @return OrderInfoDto
     */
    @GetMapping("/orderInfo/getByOrderNum/{orderNum}")
    Result<OrderInfoDto> getByOrderNum(@PathVariable("orderNum") String orderNum);

    /**
     * 完成订单
     * @param orderNum 订单编号
     * @return String
     */
    @GetMapping("/orderInfo/completeOrder/{orderNum}")
    Result<String> completeOrder(@PathVariable("orderNum") String orderNum);
}
